package game.Engine.Entity;

import java.awt.Point;

import game.display.Images;

public class Tile extends Entity {
	private char ch;
	public Tile(Point p, char ch){
		super(0,0,null);
		this.x = (double)p.getX();
		this.y = (double)p.getY();
		this.state = State.NORMAL;
		switch(Character.toLowerCase(ch)) {
		case 'a':
			gi = Images.TILE_A.image();
			break;
		case 'b':
			gi = Images.TILE_B.image();
			break;
		case 'c':
			gi = Images.TILE_C.image();
			break;
		case 'd':
			gi = Images.TILE_D.image();
			break;
		case 'e':
			gi = Images.TILE_E.image();
			break;
		case 'f':
			gi = Images.TILE_F.image();
			break;
		case 'g':
			gi = Images.TILE_G.image();
			break;
		case 'h':
			gi = Images.TILE_H.image();
			break;
		case 'i':
			gi = Images.TILE_I.image();
			break;
		case 'j':
			gi = Images.TILE_J.image();
			break;
		case 'k':
			gi = Images.TILE_K.image();
			break;
		case 'l':
			gi = Images.TILE_L.image();
			break;
		case 'm':
			gi = Images.TILE_M.image();
			break;
		case 'n':
			gi = Images.TILE_N.image();
			break;
		default:
			gi = Images.TILE_A.image();
			break;
		}
	}
	@Override 
	public void update(long timeElapsed) {
		super.update(timeElapsed);
		
	}
	public void updateImage(){
		switch(Character.toLowerCase(ch)) {
		case 'a':
			gi = Images.TILE_A.image();
			break;
		case 'b':
			gi = Images.TILE_B.image();
			break;
		case 'c':
			gi = Images.TILE_C.image();
			break;
		case 'd':
			gi = Images.TILE_D.image();
			break;
		case 'e':
			gi = Images.TILE_E.image();
			break;
		case 'f':
			gi = Images.TILE_F.image();
			break;
		case 'g':
			gi = Images.TILE_G.image();
			break;
		case 'h':
			gi = Images.TILE_H.image();
			break;
		case 'i':
			gi = Images.TILE_I.image();
			break;
		case 'j':
			gi = Images.TILE_J.image();
			break;
		case 'k':
			gi = Images.TILE_K.image();
			break;
		case 'l':
			gi = Images.TILE_L.image();
			break;
		case 'm':
			gi = Images.TILE_M.image();
			break;
		case 'n':
			gi = Images.TILE_N.image();
			break;
		default:
			gi = Images.TILE_A.image();
			break;
		}
	}
	
	public char getCH(){
		return ch;
	}
	
	 public void matchWith(Tile t){
			z = t.getZ();
			x = t.getX();
			y = t.getY();
			dx = t.getVelocityX();
			dy = t.getVelocityY();
			state = t.getState();
			ch = t.getCH();
	 }
}